package com.wenhai.spring.dependency.injection;

import com.wenhai.spring.dependency.repository.UserRepository;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DependencyInjectionDemo {
    public static void main(String[] args) throws InterruptedException {
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("META-INF/dependency-injection-context.xml");
        UserRepository userRepository = beanFactory.getBean("userRepository", UserRepository.class);
        System.out.println(userRepository.getUserCollection());
        System.out.println(userRepository.getBeanFactory());
        System.out.println(userRepository.getUserObjectFactory().getObject());
    }


}
